"""Helper functions

Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to templates as 'h'.
"""
# Import helpers as desired, or define your own, ie:
#from webhelpers.html.tags import checkbox, password

class KespaLinks(object):
    def __init__(self):
        self.schedule_url = 'http://www.e-sports.or.kr/schedule/daily01_sche.kea?m_code=sche_12&gDate=%s&gDvs=T'
        self.player_url = 'http://www.e-sports.or.kr/teams/player1.kea?m_code=team_24&pGame=1&pCode=%d'

    def schedule(self, date):
        date_parsed = date.strftime('%Y%m%d')

        return self.schedule_url % date_parsed

    def player(self, id):
        if id:
            return self.player_url % id
        else:
            return 'None'

kespa = KespaLinks()

